#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>

using namespace std;

const int N = 5e2+7;
stack <int> st;
int n,k;
string s,s1;
int ans;
int dp[N][N][3],len;

int main(){
	cin >> n >> k;
	cin >> s;
	len = s.size();
	for(int i = 0; i < len; i++) s1[i+1] = s[i];
/*	for(int i = 0; i <= n; i++)
		for(int j = 0; j <= k; j++)
			dp[i][j][0]=dp[i][j][1]=dp[i][j][2]=0;
	dp[0][0][0] = dp[0][0][1]=dp[0][0][2] = 0;
	for(int i = 0; i < len; i++)
		for(int j = 0; j <= k; j++){
		if(s[i] == '?'){
			for(int j = 0; j <= k; j++)
				dp[i][j][0] = dp[i-1][j-1][0]+dp[i-1][j][1]+dp[i-1][j][2];
		}
		else if(s[i] == '('){
			dp[i][j][1] = dp[i-1][j-]
		}
		else if(s[i] == ')'){
			
		}*/
	cout << n*k%34;	
}
